.class Lcom/melesta/engine/FacebookOperations;
.super Ljava/lang/Object;
.source "FacebookOperations.java"


# static fields
.field static final PUBLISH_PERMISSIONS:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field static final READ_PERMISSIONS:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field protected static mFacebookPageId:Ljava/lang/String;

.field protected static mFacebookPageLink:Ljava/lang/String;

.field protected static mFacebookPageName:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 7

    .prologue
    const/4 v6, 0x3

    const/4 v5, 0x2

    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 807
    const/4 v0, 0x5

    new-array v0, v0, [Ljava/lang/String;

    const-string v1, "user_likes"

    aput-object v1, v0, v3

    const-string v1, "email"

    aput-object v1, v0, v4

    const-string v1, "read_stream"

    aput-object v1, v0, v5

    const-string v1, "user_games_activity"

    aput-object v1, v0, v6

    const/4 v1, 0x4

    const-string v2, "friends_games_activity"

    aput-object v2, v0, v1

    invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    sput-object v0, Lcom/melesta/engine/FacebookOperations;->READ_PERMISSIONS:Ljava/util/List;

    .line 809
    new-array v0, v6, [Ljava/lang/String;

    const-string v1, "publish_actions"

    aput-object v1, v0, v3

    const-string v1, "publish_stream"

    aput-object v1, v0, v4

    const-string v1, "manage_notifications"

    aput-object v1, v0, v5

    invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    sput-object v0, Lcom/melesta/engine/FacebookOperations;->PUBLISH_PERMISSIONS:Ljava/util/List;

    return-void
.end method

.method constructor <init>()V
    .locals 0

    .prologue
    .line 27
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$000(Landroid/os/Bundle;)Ljava/lang/String;
    .locals 1
    .parameter "x0"

    .prologue
    .line 27
    invoke-static {p0}, Lcom/melesta/engine/FacebookOperations;->getUserIdsForWhomRequestWasSended(Landroid/os/Bundle;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static deleteNotify(Ljava/lang/String;)V
    .locals 8
    .parameter "notify_id"

    .prologue
    .line 881
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v1

    .line 882
    .local v1, session:Lcom/facebook/Session;
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isOpened()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isClosed()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 905
    .end local v1           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 885
    .restart local v1       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v7

    .line 886
    .local v7, me:Lcom/melesta/engine/EngineActivity;
    if-eqz v7, :cond_0

    .line 889
    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    .line 890
    .local v3, param:Landroid/os/Bundle;
    const-string v2, "method"

    const-string v4, "delete"

    invoke-virtual {v3, v2, v4}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 891
    new-instance v0, Lcom/facebook/Request;

    sget-object v4, Lcom/facebook/HttpMethod;->DELETE:Lcom/facebook/HttpMethod;

    new-instance v5, Lcom/melesta/engine/FacebookOperations$12;

    invoke-direct {v5}, Lcom/melesta/engine/FacebookOperations$12;-><init>()V

    move-object v2, p0

    invoke-direct/range {v0 .. v5}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 901
    .local v0, r:Lcom/facebook/Request;
    invoke-static {v7, v0}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 902
    .end local v0           #r:Lcom/facebook/Request;
    .end local v1           #session:Lcom/facebook/Session;
    .end local v3           #param:Landroid/os/Bundle;
    .end local v7           #me:Lcom/melesta/engine/EngineActivity;
    :catch_0
    move-exception v6

    .line 903
    .local v6, exc:Ljava/lang/Exception;
    const-string v2, "facebookdeleteNotify"

    invoke-static {v2, v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookGetGroupInfo(Ljava/lang/String;II)V
    .locals 8
    .parameter "group_id"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 626
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v1

    .line 627
    .local v1, session:Lcom/facebook/Session;
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isOpened()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isClosed()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 695
    .end local v1           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 630
    .restart local v1       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v7

    .line 631
    .local v7, me:Lcom/melesta/engine/EngineActivity;
    move-object v2, p0

    .line 633
    .local v2, graphPath:Ljava/lang/String;
    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    .line 634
    .local v3, params:Landroid/os/Bundle;
    const-string v4, "fields"

    const-string v5, "id,name,link,likes,picture"

    invoke-virtual {v3, v4, v5}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 635
    new-instance v0, Lcom/facebook/Request;

    const/4 v4, 0x0

    new-instance v5, Lcom/melesta/engine/FacebookOperations$9;

    invoke-direct {v5, v7, p0, p1, p2}, Lcom/melesta/engine/FacebookOperations$9;-><init>(Lcom/melesta/engine/EngineActivity;Ljava/lang/String;II)V

    invoke-direct/range {v0 .. v5}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 691
    .local v0, request:Lcom/facebook/Request;
    invoke-static {v7, v0}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 692
    .end local v0           #request:Lcom/facebook/Request;
    .end local v1           #session:Lcom/facebook/Session;
    .end local v2           #graphPath:Ljava/lang/String;
    .end local v3           #params:Landroid/os/Bundle;
    .end local v7           #me:Lcom/melesta/engine/EngineActivity;
    :catch_0
    move-exception v6

    .line 693
    .local v6, exc:Ljava/lang/Exception;
    const-string v4, "facebookGetGroupInfo"

    invoke-static {v4, v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookGetUserInfo(Ljava/lang/String;II)V
    .locals 8
    .parameter "user_facebook_id"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 550
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v1

    .line 551
    .local v1, session:Lcom/facebook/Session;
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isOpened()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isClosed()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 622
    .end local v1           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 554
    .restart local v1       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v7

    .line 555
    .local v7, me:Lcom/melesta/engine/EngineActivity;
    move-object v2, p0

    .line 557
    .local v2, graphPath:Ljava/lang/String;
    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    .line 558
    .local v3, params:Landroid/os/Bundle;
    const-string v4, "fields"

    const-string v5, "id,name,email,picture"

    invoke-virtual {v3, v4, v5}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 559
    new-instance v0, Lcom/facebook/Request;

    const/4 v4, 0x0

    new-instance v5, Lcom/melesta/engine/FacebookOperations$8;

    invoke-direct {v5, p0, v7, p1, p2}, Lcom/melesta/engine/FacebookOperations$8;-><init>(Ljava/lang/String;Lcom/melesta/engine/EngineActivity;II)V

    invoke-direct/range {v0 .. v5}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 618
    .local v0, request:Lcom/facebook/Request;
    invoke-static {v7, v0}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 619
    .end local v0           #request:Lcom/facebook/Request;
    .end local v1           #session:Lcom/facebook/Session;
    .end local v2           #graphPath:Ljava/lang/String;
    .end local v3           #params:Landroid/os/Bundle;
    .end local v7           #me:Lcom/melesta/engine/EngineActivity;
    :catch_0
    move-exception v6

    .line 620
    .local v6, exc:Ljava/lang/Exception;
    const-string v4, "facebookGetUserInfo"

    invoke-static {v4, v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookInviteUsersInGame(Ljava/lang/String;Ljava/lang/String;II)V
    .locals 5
    .parameter "users_list"
    .parameter "body"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 770
    :try_start_0
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v1

    .line 771
    .local v1, me:Lcom/melesta/engine/EngineActivity;
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v2

    .line 772
    .local v2, session:Lcom/facebook/Session;
    if-eqz v2, :cond_0

    invoke-virtual {v2}, Lcom/facebook/Session;->isOpened()Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-virtual {v2}, Lcom/facebook/Session;->isClosed()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 773
    :cond_0
    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-static {v3, v4}, Lcom/melesta/engine/FacebookOperations;->facebookLogin(II)V

    .line 781
    .end local v1           #me:Lcom/melesta/engine/EngineActivity;
    .end local v2           #session:Lcom/facebook/Session;
    :goto_0
    return-void

    .line 777
    .restart local v1       #me:Lcom/melesta/engine/EngineActivity;
    .restart local v2       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {p1, p2, p3, v1, p0}, Lcom/melesta/engine/FacebookOperations;->inviteUsersToFacebook(Ljava/lang/String;IILcom/melesta/engine/EngineActivity;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 778
    .end local v1           #me:Lcom/melesta/engine/EngineActivity;
    .end local v2           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v0

    .line 779
    .local v0, exc:Ljava/lang/Exception;
    const-string v3, "facebookInviteUsersInGame"

    invoke-static {v3, v0}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookIsUserLikedGroup(Ljava/lang/String;Ljava/lang/String;II)V
    .locals 13
    .parameter "user_id"
    .parameter "group_id"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 277
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v12

    .line 278
    .local v12, session:Lcom/facebook/Session;
    if-eqz v12, :cond_0

    invoke-virtual {v12}, Lcom/facebook/Session;->isOpened()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v12}, Lcom/facebook/Session;->isClosed()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 346
    .end local v12           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 281
    .restart local v12       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v2

    .line 283
    .local v2, me:Lcom/melesta/engine/EngineActivity;
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "/likes/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    .line 285
    .local v10, graphPath:Ljava/lang/String;
    new-instance v11, Lcom/facebook/Request;

    const/4 v6, 0x0

    const/4 v7, 0x0

    new-instance v0, Lcom/melesta/engine/FacebookOperations$4;

    move-object v1, p1

    move-object v3, p0

    move v4, p2

    move/from16 v5, p3

    invoke-direct/range {v0 .. v5}, Lcom/melesta/engine/FacebookOperations$4;-><init>(Ljava/lang/String;Lcom/melesta/engine/EngineActivity;Ljava/lang/String;II)V

    move-object v3, v11

    move-object v4, v12

    move-object v5, v10

    move-object v8, v0

    invoke-direct/range {v3 .. v8}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 342
    .local v11, request:Lcom/facebook/Request;
    invoke-static {v2, v11}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 343
    .end local v2           #me:Lcom/melesta/engine/EngineActivity;
    .end local v10           #graphPath:Ljava/lang/String;
    .end local v11           #request:Lcom/facebook/Request;
    .end local v12           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v9

    .line 344
    .local v9, exc:Ljava/lang/Exception;
    const-string v0, "facebookUpdateInfo"

    invoke-static {v0, v9}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookLike()V
    .locals 9

    .prologue
    .line 699
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v4

    .line 700
    .local v4, session:Lcom/facebook/Session;
    if-eqz v4, :cond_0

    invoke-virtual {v4}, Lcom/facebook/Session;->isOpened()Z

    move-result v6

    if-eqz v6, :cond_0

    invoke-virtual {v4}, Lcom/facebook/Session;->isClosed()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 701
    :cond_0
    const/4 v6, 0x0

    const/4 v7, 0x0

    invoke-static {v6, v7}, Lcom/melesta/engine/FacebookOperations;->facebookLogin(II)V

    .line 719
    :goto_0
    return-void

    .line 705
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v3

    .line 708
    .local v3, me:Lcom/melesta/engine/EngineActivity;
    :try_start_1
    invoke-virtual {v3}, Lcom/melesta/engine/EngineActivity;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v6

    const-string v7, "com.facebook.katana"

    const/4 v8, 0x0

    invoke-virtual {v6, v7, v8}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    .line 709
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "fb://profile/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    sget-object v7, Lcom/melesta/engine/FacebookOperations;->mFacebookPageId:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    move-result-object v5

    .line 713
    .local v5, uri:Landroid/net/Uri;
    :goto_1
    :try_start_2
    new-instance v2, Landroid/content/Intent;

    const-string v6, "android.intent.action.VIEW"

    invoke-direct {v2, v6, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 715
    .local v2, i:Landroid/content/Intent;
    invoke-virtual {v3, v2}, Lcom/melesta/engine/EngineActivity;->startActivity(Landroid/content/Intent;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    .line 716
    .end local v2           #i:Landroid/content/Intent;
    .end local v3           #me:Lcom/melesta/engine/EngineActivity;
    .end local v5           #uri:Landroid/net/Uri;
    :catch_0
    move-exception v1

    .line 717
    .local v1, exc:Ljava/lang/Exception;
    const-string v6, "facebookLike"

    invoke-static {v6, v1}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0

    .line 710
    .end local v1           #exc:Ljava/lang/Exception;
    .restart local v3       #me:Lcom/melesta/engine/EngineActivity;
    :catch_1
    move-exception v0

    .line 711
    .local v0, e:Ljava/lang/Exception;
    :try_start_3
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "https://www.facebook.com/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    sget-object v7, Lcom/melesta/engine/FacebookOperations;->mFacebookPageId:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0

    move-result-object v5

    .restart local v5       #uri:Landroid/net/Uri;
    goto :goto_1
.end method

.method static facebookLogin(II)V
    .locals 6
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 785
    :try_start_0
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v2

    .line 787
    .local v2, me:Lcom/melesta/engine/EngineActivity;
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v4

    .line 788
    .local v4, session:Lcom/facebook/Session;
    new-instance v1, Lcom/melesta/engine/EngineActivity$SessionStatusCallback;

    invoke-virtual {v2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    invoke-direct {v1, v2, p0, p1}, Lcom/melesta/engine/EngineActivity$SessionStatusCallback;-><init>(Lcom/melesta/engine/EngineActivity;II)V

    .line 789
    .local v1, fcb:Lcom/melesta/engine/EngineActivity$SessionStatusCallback;
    new-instance v5, Lcom/facebook/Session$OpenRequest;

    invoke-direct {v5, v2}, Lcom/facebook/Session$OpenRequest;-><init>(Landroid/app/Activity;)V

    invoke-virtual {v5, v1}, Lcom/facebook/Session$OpenRequest;->setCallback(Lcom/facebook/Session$StatusCallback;)Lcom/facebook/Session$OpenRequest;

    move-result-object v3

    .line 790
    .local v3, openRequest:Lcom/facebook/Session$OpenRequest;
    if-eqz v3, :cond_0

    .line 791
    sget-object v5, Lcom/facebook/SessionDefaultAudience;->FRIENDS:Lcom/facebook/SessionDefaultAudience;

    invoke-virtual {v3, v5}, Lcom/facebook/Session$OpenRequest;->setDefaultAudience(Lcom/facebook/SessionDefaultAudience;)Lcom/facebook/Session$OpenRequest;

    .line 792
    sget-object v5, Lcom/melesta/engine/FacebookOperations;->READ_PERMISSIONS:Ljava/util/List;

    invoke-virtual {v3, v5}, Lcom/facebook/Session$OpenRequest;->setPermissions(Ljava/util/List;)Lcom/facebook/Session$OpenRequest;

    .line 793
    sget-object v5, Lcom/facebook/SessionLoginBehavior;->SSO_WITH_FALLBACK:Lcom/facebook/SessionLoginBehavior;

    invoke-virtual {v3, v5}, Lcom/facebook/Session$OpenRequest;->setLoginBehavior(Lcom/facebook/SessionLoginBehavior;)Lcom/facebook/Session$OpenRequest;

    .line 795
    :cond_0
    invoke-virtual {v4}, Lcom/facebook/Session;->isOpened()Z

    move-result v5

    if-nez v5, :cond_1

    invoke-virtual {v4}, Lcom/facebook/Session;->isClosed()Z

    move-result v5

    if-nez v5, :cond_1

    .line 796
    invoke-virtual {v4, v3}, Lcom/facebook/Session;->openForRead(Lcom/facebook/Session$OpenRequest;)V

    .line 805
    .end local v1           #fcb:Lcom/melesta/engine/EngineActivity$SessionStatusCallback;
    .end local v2           #me:Lcom/melesta/engine/EngineActivity;
    .end local v3           #openRequest:Lcom/facebook/Session$OpenRequest;
    .end local v4           #session:Lcom/facebook/Session;
    :goto_0
    return-void

    .line 800
    .restart local v1       #fcb:Lcom/melesta/engine/EngineActivity$SessionStatusCallback;
    .restart local v2       #me:Lcom/melesta/engine/EngineActivity;
    .restart local v3       #openRequest:Lcom/facebook/Session$OpenRequest;
    .restart local v4       #session:Lcom/facebook/Session;
    :cond_1
    const/4 v5, 0x1

    invoke-static {v2, v5, v1}, Lcom/facebook/Session;->openActiveSession(Landroid/app/Activity;ZLcom/facebook/Session$StatusCallback;)Lcom/facebook/Session;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 802
    .end local v1           #fcb:Lcom/melesta/engine/EngineActivity$SessionStatusCallback;
    .end local v2           #me:Lcom/melesta/engine/EngineActivity;
    .end local v3           #openRequest:Lcom/facebook/Session$OpenRequest;
    .end local v4           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v0

    .line 803
    .local v0, exc:Ljava/lang/Exception;
    const-string v5, "facebookLogin"

    invoke-static {v5, v0}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookPost(Ljava/lang/String;II)V
    .locals 5
    .parameter "body"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 723
    :try_start_0
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v1

    .line 724
    .local v1, me:Lcom/melesta/engine/EngineActivity;
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v2

    .line 725
    .local v2, session:Lcom/facebook/Session;
    if-eqz v2, :cond_0

    invoke-virtual {v2}, Lcom/facebook/Session;->isOpened()Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-virtual {v2}, Lcom/facebook/Session;->isClosed()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 726
    :cond_0
    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-static {v3, v4}, Lcom/melesta/engine/FacebookOperations;->facebookLogin(II)V

    .line 765
    .end local v1           #me:Lcom/melesta/engine/EngineActivity;
    .end local v2           #session:Lcom/facebook/Session;
    :goto_0
    return-void

    .line 730
    .restart local v1       #me:Lcom/melesta/engine/EngineActivity;
    .restart local v2       #session:Lcom/facebook/Session;
    :cond_1
    iget-object v3, v1, Lcom/melesta/engine/EngineActivity;->mHandler:Landroid/os/Handler;

    new-instance v4, Lcom/melesta/engine/FacebookOperations$10;

    invoke-direct {v4, p0, v1, p1, p2}, Lcom/melesta/engine/FacebookOperations$10;-><init>(Ljava/lang/String;Lcom/melesta/engine/EngineActivity;II)V

    invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 762
    .end local v1           #me:Lcom/melesta/engine/EngineActivity;
    .end local v2           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v0

    .line 763
    .local v0, exc:Ljava/lang/Exception;
    const-string v3, "facebookPost"

    invoke-static {v3, v0}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookSendRequest(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZII)V
    .locals 11
    .parameter "friends"
    .parameter "message"
    .parameter "data"
    .parameter "is_suggestion"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 438
    :try_start_0
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v5

    .line 439
    .local v5, me:Lcom/melesta/engine/EngineActivity;
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v9

    .line 440
    .local v9, session:Lcom/facebook/Session;
    if-eqz v9, :cond_0

    invoke-virtual {v9}, Lcom/facebook/Session;->isOpened()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v9}, Lcom/facebook/Session;->isClosed()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 441
    :cond_0
    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/melesta/engine/FacebookOperations;->facebookLogin(II)V

    .line 494
    .end local v5           #me:Lcom/melesta/engine/EngineActivity;
    .end local v9           #session:Lcom/facebook/Session;
    :goto_0
    return-void

    .line 445
    .restart local v5       #me:Lcom/melesta/engine/EngineActivity;
    .restart local v9       #session:Lcom/facebook/Session;
    :cond_1
    iget-object v10, v5, Lcom/melesta/engine/EngineActivity;->mHandler:Landroid/os/Handler;

    new-instance v0, Lcom/melesta/engine/FacebookOperations$6;

    move-object v1, p0

    move-object v2, p2

    move-object v3, p1

    move v4, p3

    move v6, p4

    move/from16 v7, p5

    invoke-direct/range {v0 .. v7}, Lcom/melesta/engine/FacebookOperations$6;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/melesta/engine/EngineActivity;II)V

    invoke-virtual {v10, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 491
    .end local v5           #me:Lcom/melesta/engine/EngineActivity;
    .end local v9           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v8

    .line 492
    .local v8, exc:Ljava/lang/Exception;
    const-string v0, "facebookSendRequest"

    invoke-static {v0, v8}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookSendRequestToFriends(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZII)V
    .locals 11
    .parameter "friends"
    .parameter "message"
    .parameter "data"
    .parameter "is_suggestion"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 363
    :try_start_0
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v5

    .line 364
    .local v5, me:Lcom/melesta/engine/EngineActivity;
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v9

    .line 365
    .local v9, session:Lcom/facebook/Session;
    if-eqz v9, :cond_0

    invoke-virtual {v9}, Lcom/facebook/Session;->isOpened()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v9}, Lcom/facebook/Session;->isClosed()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 366
    :cond_0
    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/melesta/engine/FacebookOperations;->facebookLogin(II)V

    .line 419
    .end local v5           #me:Lcom/melesta/engine/EngineActivity;
    .end local v9           #session:Lcom/facebook/Session;
    :goto_0
    return-void

    .line 370
    .restart local v5       #me:Lcom/melesta/engine/EngineActivity;
    .restart local v9       #session:Lcom/facebook/Session;
    :cond_1
    iget-object v10, v5, Lcom/melesta/engine/EngineActivity;->mHandler:Landroid/os/Handler;

    new-instance v0, Lcom/melesta/engine/FacebookOperations$5;

    move-object v1, p0

    move-object v2, p2

    move-object v3, p1

    move v4, p3

    move v6, p4

    move/from16 v7, p5

    invoke-direct/range {v0 .. v7}, Lcom/melesta/engine/FacebookOperations$5;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/melesta/engine/EngineActivity;II)V

    invoke-virtual {v10, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 416
    .end local v5           #me:Lcom/melesta/engine/EngineActivity;
    .end local v9           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v8

    .line 417
    .local v8, exc:Ljava/lang/Exception;
    const-string v0, "facebookPost"

    invoke-static {v0, v8}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static facebookSetUserScore(Ljava/lang/String;III)V
    .locals 9
    .parameter "user_facebook_id"
    .parameter "score"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 500
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v1

    .line 501
    .local v1, session:Lcom/facebook/Session;
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isOpened()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isClosed()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 546
    .end local v1           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 504
    .restart local v1       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v8

    .line 505
    .local v8, me:Lcom/melesta/engine/EngineActivity;
    const-string v7, "/me/scores"

    .line 507
    .local v7, graphPath:Ljava/lang/String;
    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    .line 508
    .local v3, params:Landroid/os/Bundle;
    const-string v2, "score"

    invoke-virtual {v3, v2, p1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 512
    new-instance v0, Lcom/facebook/Request;

    const-string v2, "/me/scores"

    const/4 v4, 0x0

    new-instance v5, Lcom/melesta/engine/FacebookOperations$7;

    invoke-direct {v5, v8}, Lcom/melesta/engine/FacebookOperations$7;-><init>(Lcom/melesta/engine/EngineActivity;)V

    invoke-direct/range {v0 .. v5}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 542
    .local v0, request:Lcom/facebook/Request;
    invoke-static {v8, v0}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 543
    .end local v0           #request:Lcom/facebook/Request;
    .end local v1           #session:Lcom/facebook/Session;
    .end local v3           #params:Landroid/os/Bundle;
    .end local v7           #graphPath:Ljava/lang/String;
    .end local v8           #me:Lcom/melesta/engine/EngineActivity;
    :catch_0
    move-exception v6

    .line 544
    .local v6, exc:Ljava/lang/Exception;
    const-string v2, "facebookGetUserInfo"

    invoke-static {v2, v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public static getUserFriends(Ljava/lang/String;II)V
    .locals 10
    .parameter "user_facebook_id"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 35
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v1

    .line 36
    .local v1, session:Lcom/facebook/Session;
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isOpened()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isClosed()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 112
    .end local v1           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 39
    .restart local v1       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v7

    .line 41
    .local v7, me:Lcom/melesta/engine/EngineActivity;
    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    .line 43
    .local v3, params:Landroid/os/Bundle;
    const-string v4, "SELECT uid, name, is_app_user, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = %s)"

    const/4 v2, 0x1

    new-array v5, v2, [Ljava/lang/Object;

    const/4 v9, 0x0

    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v2

    if-lez v2, :cond_2

    move-object v2, p0

    :goto_1
    aput-object v2, v5, v9

    invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    .line 47
    .local v8, q:Ljava/lang/String;
    const-string v2, "q"

    invoke-virtual {v3, v2, v8}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 49
    new-instance v0, Lcom/facebook/Request;

    const-string v2, "/fql"

    const/4 v4, 0x0

    new-instance v5, Lcom/melesta/engine/FacebookOperations$1;

    invoke-direct {v5, v7, p0, p1, p2}, Lcom/melesta/engine/FacebookOperations$1;-><init>(Lcom/melesta/engine/EngineActivity;Ljava/lang/String;II)V

    invoke-direct/range {v0 .. v5}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 108
    .local v0, request:Lcom/facebook/Request;
    invoke-static {v7, v0}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 109
    .end local v0           #request:Lcom/facebook/Request;
    .end local v1           #session:Lcom/facebook/Session;
    .end local v3           #params:Landroid/os/Bundle;
    .end local v7           #me:Lcom/melesta/engine/EngineActivity;
    .end local v8           #q:Ljava/lang/String;
    :catch_0
    move-exception v6

    .line 110
    .local v6, exc:Ljava/lang/Exception;
    const-string v2, "facebookGetUserInfo"

    invoke-static {v2, v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0

    .line 43
    .end local v6           #exc:Ljava/lang/Exception;
    .restart local v1       #session:Lcom/facebook/Session;
    .restart local v3       #params:Landroid/os/Bundle;
    .restart local v7       #me:Lcom/melesta/engine/EngineActivity;
    :cond_2
    :try_start_1
    const-string v2, "me()"
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1
.end method

.method public static getUserGameFriends(Ljava/lang/String;II)V
    .locals 11
    .parameter "user_facebook_id"
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 116
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v1

    .line 117
    .local v1, session:Lcom/facebook/Session;
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isOpened()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-virtual {v1}, Lcom/facebook/Session;->isClosed()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 193
    .end local v1           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 120
    .restart local v1       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v8

    .line 121
    .local v8, me:Lcom/melesta/engine/EngineActivity;
    const-string v7, "/fql"

    .line 123
    .local v7, graphPath:Ljava/lang/String;
    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    .line 125
    .local v3, params:Landroid/os/Bundle;
    const-string v4, "SELECT uid, name, is_app_user, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = %s) AND is_app_user = 1"

    const/4 v2, 0x1

    new-array v5, v2, [Ljava/lang/Object;

    const/4 v10, 0x0

    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v2

    if-lez v2, :cond_2

    move-object v2, p0

    :goto_1
    aput-object v2, v5, v10

    invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    .line 129
    .local v9, q:Ljava/lang/String;
    const-string v2, "q"

    invoke-virtual {v3, v2, v9}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 131
    new-instance v0, Lcom/facebook/Request;

    const-string v2, "/fql"

    const/4 v4, 0x0

    new-instance v5, Lcom/melesta/engine/FacebookOperations$2;

    invoke-direct {v5, v8, p0, p1, p2}, Lcom/melesta/engine/FacebookOperations$2;-><init>(Lcom/melesta/engine/EngineActivity;Ljava/lang/String;II)V

    invoke-direct/range {v0 .. v5}, Lcom/facebook/Request;-><init>(Lcom/facebook/Session;Ljava/lang/String;Landroid/os/Bundle;Lcom/facebook/HttpMethod;Lcom/facebook/Request$Callback;)V

    .line 189
    .local v0, request:Lcom/facebook/Request;
    invoke-static {v8, v0}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 190
    .end local v0           #request:Lcom/facebook/Request;
    .end local v1           #session:Lcom/facebook/Session;
    .end local v3           #params:Landroid/os/Bundle;
    .end local v7           #graphPath:Ljava/lang/String;
    .end local v8           #me:Lcom/melesta/engine/EngineActivity;
    .end local v9           #q:Ljava/lang/String;
    :catch_0
    move-exception v6

    .line 191
    .local v6, exc:Ljava/lang/Exception;
    const-string v2, "facebookGetUserInfo"

    invoke-static {v2, v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0

    .line 125
    .end local v6           #exc:Ljava/lang/Exception;
    .restart local v1       #session:Lcom/facebook/Session;
    .restart local v3       #params:Landroid/os/Bundle;
    .restart local v7       #graphPath:Ljava/lang/String;
    .restart local v8       #me:Lcom/melesta/engine/EngineActivity;
    :cond_2
    :try_start_1
    const-string v2, "me()"
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1
.end method

.method private static getUserIdsForWhomRequestWasSended(Landroid/os/Bundle;)Ljava/lang/String;
    .locals 7
    .parameter "values"

    .prologue
    .line 212
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    .line 213
    .local v2, sb:Ljava/lang/StringBuilder;
    const/4 v0, 0x0

    .line 214
    .local v0, i:I
    :goto_0
    const-string v3, "to[%d]"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-static {v3, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 215
    .local v1, id:Ljava/lang/String;
    if-nez v1, :cond_0

    .line 225
    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    return-object v3

    .line 219
    :cond_0
    invoke-virtual {v2}, Ljava/lang/StringBuilder;->length()I

    move-result v3

    if-lez v3, :cond_1

    .line 220
    const/16 v3, 0x2c

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    .line 222
    :cond_1
    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 213
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method private static inviteUsersToFacebook(Ljava/lang/String;IILcom/melesta/engine/EngineActivity;Ljava/lang/String;)V
    .locals 6
    .parameter "body"
    .parameter "user_data"
    .parameter "callback"
    .parameter "me"
    .parameter "to"

    .prologue
    .line 230
    invoke-static {p4}, Lcom/melesta/engine/FacebookOperations;->truncIdList(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 232
    .local v2, suggestions:Ljava/lang/String;
    new-instance v0, Lcom/melesta/engine/FacebookOperations$3;

    move-object v1, p0

    move-object v3, p3

    move v4, p1

    move v5, p2

    invoke-direct/range {v0 .. v5}, Lcom/melesta/engine/FacebookOperations$3;-><init>(Ljava/lang/String;Ljava/lang/String;Lcom/melesta/engine/EngineActivity;II)V

    invoke-virtual {p3, v0}, Lcom/melesta/engine/EngineActivity;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 272
    return-void
.end method

.method static receiveNotify(II)V
    .locals 6
    .parameter "user_data"
    .parameter "callback"

    .prologue
    .line 820
    :try_start_0
    invoke-static {}, Lcom/facebook/Session;->getActiveSession()Lcom/facebook/Session;

    move-result-object v3

    .line 821
    .local v3, session:Lcom/facebook/Session;
    if-eqz v3, :cond_0

    invoke-virtual {v3}, Lcom/facebook/Session;->isOpened()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-virtual {v3}, Lcom/facebook/Session;->isClosed()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 877
    .end local v3           #session:Lcom/facebook/Session;
    :cond_0
    :goto_0
    return-void

    .line 824
    .restart local v3       #session:Lcom/facebook/Session;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v1

    .line 826
    .local v1, me:Lcom/melesta/engine/EngineActivity;
    const-string v4, "me/apprequests"

    new-instance v5, Lcom/melesta/engine/FacebookOperations$11;

    invoke-direct {v5, v1, p0, p1}, Lcom/melesta/engine/FacebookOperations$11;-><init>(Lcom/melesta/engine/EngineActivity;II)V

    invoke-static {v3, v4, v5}, Lcom/facebook/Request;->newGraphPathRequest(Lcom/facebook/Session;Ljava/lang/String;Lcom/facebook/Request$Callback;)Lcom/facebook/Request;

    move-result-object v2

    .line 873
    .local v2, request:Lcom/facebook/Request;
    invoke-static {v1, v2}, Lcom/melesta/engine/Helpers;->runFbRequestOnUiThread(Lcom/melesta/engine/EngineActivity;Lcom/facebook/Request;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 874
    .end local v1           #me:Lcom/melesta/engine/EngineActivity;
    .end local v2           #request:Lcom/facebook/Request;
    .end local v3           #session:Lcom/facebook/Session;
    :catch_0
    move-exception v0

    .line 875
    .local v0, exc:Ljava/lang/Exception;
    const-string v4, "facebookReceiveNotify"

    invoke-static {v4, v0}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method static truncIdList(Ljava/lang/String;)Ljava/lang/String;
    .locals 5
    .parameter "ids"

    .prologue
    .line 196
    const/4 v0, 0x0

    .line 197
    .local v0, counter:I
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v2

    .line 198
    .local v2, len:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-ge v1, v2, :cond_2

    .line 199
    invoke-virtual {p0, v1}, Ljava/lang/String;->charAt(I)C

    move-result v3

    const/16 v4, 0x2c

    if-eq v3, v4, :cond_1

    .line 198
    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 202
    :cond_1
    add-int/lit8 v0, v0, 0x1

    .line 204
    const/16 v3, 0x32

    if-ne v0, v3, :cond_0

    .line 205
    const/4 v3, 0x0

    invoke-virtual {p0, v3, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p0

    .line 208
    .end local p0
    :cond_2
    return-object p0
.end method
